<#assign module="chart"/>

<@override name="header">
<link rel="stylesheet" href="${ctx}/assets/css/datetimepicker.css">
<style>
	.table > thead > tr > th {
	    text-align:center;
	}
	.table > tbody > tr > td{
		vertical-align:middle;
		text-align:center;
	}
</style>
</@override>
<@override name="body">
<div class="row">
	<div class="col-xs-13">
		<div class="col-md-2">
			<ul class="list-group">
	        	<#--
	        	<li class="list-group-item"><a  href="${ctx}/chart/heatMap">热力图</a></li>
	        	-->
	        	<@daijia>
		        <li class="list-group-item"><a  href="${ctx}/chart/compositive">代驾订单汇总</a></li>
		        </@daijia>
				<@pao>
				<li class="list-group-item"><a  href="${ctx}/chart/paotuiCompositive">跑腿订单汇总</a></li>
				</@pao>
				<@zhuan>
				<li class="list-group-item"><a  href="${ctx}/chart/zhuanCompositive">专车订单汇总</a></li>
				</@zhuan>
				<@freight>
				<li class="list-group-item"><a  href="${ctx}/chart/freightCompositive">货运订单汇总</a></li>
				</@freight>
				<@zhuanxian>
				<li class="list-group-item"><a  href="${ctx}/chart/zhuanxianCompositive">快车订单汇总</a></li>
				</@zhuanxian>
		        <li class="list-group-item"><a  href="${ctx}/chart/orderYearChart">订单统计</a></li>
			    <li class="list-group-item"><a  href="${ctx}/chart/orderType">订单来源统计</a></li>
			    <li class="list-group-item"><a  href="${ctx}/chart/memberOrder1">客户消费统计</a></li>
				<li class="list-group-item"><a  href="${ctx}/chart/tableNewMemberMonth">新增客户统计</a></li>
			    <li class="list-group-item"><a  href="${ctx}/chart/driverOrder">服务人员业绩</a></li>
			    <li class="list-group-item"><a  href="${ctx}/chart/introduce">推荐员工业绩</a></li>
			    <li class="list-group-item"><a  href="${ctx}/chart/infoFee">保险费/信息费</a></li>
			    <@shiro.isMainCompany>
			    <li class="list-group-item"><a  href="${ctx}/chart/companyOrder">公司统计</a></li>
			    </@shiro.isMainCompany>
			    <!-- <li class="list-group-item"><a  href="${ctx}/chart/activity">活动统计</a></li> -->
			    <li class="list-group-item"><a  href="${ctx}/chart/driverTime">服务人员在线时间统计</a></li>
		    </ul>
		</div>
		 </div>
		<div class="col-md-10">
		     <div role="tabpanel">
		        <div class="tab-content">
		           <div role="tabpanel" class="tab-pane fade in active" id="daijiaTab"><p/>
		               <div class="row margin-top">
		                   <div class="col-xs-12">
		                       <form class="form-inline" id="SearchForm" method="get">
		                           <@shiro.isMainCompany>
										<select class="form-control" name="companyId" id="companyId">
											<option value="">全部公司</option>
								  			<#list companys as company>
								  				<option value="${company.id}" <#if companyId?? && companyId==company.id>selected="selected"</#if>>${company.abbreviation}</option>
								  			</#list>
							  			</select>
					  			   </@shiro.isMainCompany>
					  				<div class="form-group">
							  			<input type="text" class="form-control" id="param" name="param" placeholder="请输入推荐人工号" value="${param?if_exists}">
							  		</div>
							  		
							  		<div class="input-group">
										<input id="startTime" name="startTime" type="text" class="form-control" placeholder="开始时间" value="${startTime?if_exists}" />
									</div>
									
								  	<div class="form-group">
								  		<input id="endTime" name="endTime" type="text" class="form-control" placeholder="结束时间" value="${endTime?if_exists}" />
								    </div>
								   
							  		<div class="form-group">
								        <button type="button" id="daijia_search_button" class="btn btn-primary"><i class="glyphicon glyphicon-search"></i> 查询</button>
								    </div>
		                       </form>
		                   </div>
		               </div>
		               <div class="row margin-top">
		                   <div class="col-xs-12">
		                      <div class="table-responsive">
		                          <div class="panel panel-primary">
		                              <table id="daijiaTable" class="table table-hover  table-bordered">
		                                    <thead>
										  		<tr style="font-size:14px;">
										  			<th colspan="2">#</th>
										  			<@daijia>
										  				<@shiro.hasPermission name='order'>
											  				<th colspan="3">代驾</th>
											  			</@shiro.hasPermission>
										  			</@daijia>
										  			<@zhuan> 
										  			    <@shiro.hasPermission name="zhuan">
										  			    	<th colspan="3">专车</th>
										  			    </@shiro.hasPermission>
									  			   	</@zhuan> 
										  		   	<@pao>
											  			<@shiro.hasPermission name='errand'>
										  			    	<th colspan="3">跑腿</th>
										  			    </@shiro.hasPermission>
									  			   	</@pao>
									  			   	<@freight> 
										  			    <@shiro.hasPermission name="freight">
										  			    	<th colspan="3">货运</th>
										  			    </@shiro.hasPermission>
									  			   	</@freight> 
									  			   	<@zhuanxian> 
										  			    <@shiro.hasPermission name="zhuanxian">
										  			    	<th colspan="3">快车</th>
										  			    </@shiro.hasPermission>
									  			   	</@zhuanxian> 
										  		</tr>
									  		</thead>
									  		<tbody>
									  			<tr>
									  		   		<td>推荐人</td>
									  		   		<td>服务人员</td>
									  		   	   	<@daijia>
										  		   	  	<@shiro.hasPermission name='order'>
										  		   	   		<td>完成单量</td><td>订单金额</td><td>提成</td>
										  		   	  	</@shiro.hasPermission>
									  		   	 	</@daijia>
									  		   	 	<@zhuan> 
									  		   	  		<@shiro.hasPermission name='zhuan'>
									  		   	  		<td>完成单量</td><td>订单金额</td><td>提成</td>
									  		   	  		</@shiro.hasPermission>
									  		   	 	</@zhuan> 
									  		   	 	<@pao>
										  		   		<@shiro.hasPermission name='errand'>
										  		   			<td>完成单量</td><td>订单金额</td><td>提成</td>
										  		   		</@shiro.hasPermission>
									  		   	 	</@pao>
									  		   	  	<@freight> 
									  		   	  		<@shiro.hasPermission name='freight'>
									  		   	  			<td>完成单量</td><td>订单金额</td><td>提成</td>
									  		   	  		</@shiro.hasPermission>
									  		   	 	</@freight> 
									  		   	  	<@zhuanxian> 
									  		   	  		<@shiro.hasPermission name='zhuanxian'>
									  		   	  			<td>完成单量</td><td>订单金额</td><td>提成</td>
									  		   	  		</@shiro.hasPermission>
									  		   	 	</@zhuanxian> 
									  		   </tr>
									  		   <#list page.content as driver>
									  		   <tr>
									  		      <td rowspan="${driver.drivers?size}">${driver.introduced}</td>
									  		      <#list driver.drivers as dr>
									  		      	<td>${dr.username}(${dr.name})</td>
									  		      	<@daijia>
									  		      		<@shiro.hasPermission name='order'>
											  		        <td>${dr.finishNums}</td>
											  		        <td>${dr.money}</td>
											  		        <td>${dr.ticheng}</td>
									  		        	</@shiro.hasPermission>
									  		      	</@daijia>
									  		      	<@zhuan>  
									  		        	<@shiro.hasPermission name='zhuan'>
											  		        <td>${dr.zhuanche.finishNums}</td>
											  		        <td>${dr.zhuanche.money}</td>
											  		        <td>${dr.zhuanche.ticheng}</td>
									  		        	</@shiro.hasPermission>
									  		      	</@zhuan> 
									  		      	<@pao>  
										  		        <@shiro.hasPermission name='errand'>
											  		       	<td>${dr.errand.finishNums}</td>
											  		        <td>${dr.errand.money}</td>
											  		        <td>${dr.errand.ticheng}</td>
										  		        </@shiro.hasPermission>
									  		      	</@pao>
									  		        <@freight>  
										  		        <@shiro.hasPermission name='freight'>
											  		        <td>${dr.freight.finishNums}</td>
											  		        <td>${dr.freight.money}</td>
											  		        <td>${dr.freight.ticheng}</td>
										  		        </@shiro.hasPermission>
									  		      	</@freight>  
									  		        <@zhuanxian>  
										  		        <@shiro.hasPermission name='zhuanxian'>
											  		        <td>${dr.zhuanxian.finishNums}</td>
											  		        <td>${dr.zhuanxian.money}</td>
											  		        <td>${dr.zhuanxian.ticheng}</td>
										  		        </@shiro.hasPermission>
									  		      	</@zhuanxian>  
									  		        </tr>
									  		      </#list>
									  		       
									  		   </#list>
									  		  
									  		   
									  		</tbody>
		                              </table>
		                              <ul id="daijiaPage"   class="pagination pull-left pagination-sm pageshow">
									  		<li><a>共 ${page.totalElements!0} 名推荐人</a></li>
									  </ul>
									  <ul class="pagination pull-left pagination-sm pagedata"></ul>
									  <#if page.totalElements??>
                                          <ul class="pagination pull-right pagination-sm">
                                              <li><a>共 ${page.totalElements} 条数据</a></li>
											  <@pg.pager items=page.totalElements?number maxPageItems=10 export="currentPageNumber=pageNumber" url="${ctx}/chart/introduce">
												  <@pg.param name="companyId" value="${companyId?if_exists}"/>
												  <@pg.param name="param" value="${param?if_exists}"/>
												  <@pg.param name="startTime" value="${startTime?if_exists}"/>
												  <@pg.param name="endTime" value="${endTime?if_exists}"/>
												  <@pg.index>
													  <@pg.first>
                                                          <li><a href="${pageUrl}">&laquo;</a></li>
													  </@pg.first>
													  <@pg.prev>
                                                          <li><a href="${pageUrl}">&lsaquo;</a></li>
													  </@pg.prev>
													  <@pg.pages>
														  <#if currentPageNumber == pageNumber >
                                                              <li class="active"><a href="#">${pageNumber}</a></li>
														  <#else>
                                                              <li><a href="${pageUrl}">${pageNumber}</a></li>
														  </#if>
													  </@pg.pages>
													  <@pg.next>
                                                          <li><a href="${pageUrl}">&rsaquo;</a></li>
													  </@pg.next>
													  <@pg.last>
                                                          <li><a href="${pageUrl}">&raquo;</a></li>
													  </@pg.last>
												  </@pg.index>
											  </@pg.pager>
                                          </ul>
									  </#if>
		                          </div>
		                      </div>
		                   </div>
		               
		               </div>
		               
		           </div>
		          
		     
		     </div>
		</div>
		
	</div>
</div>
</@override>


<@override name="footer">
<script src="${ctx}/assets/js/bootstrap-datetimepicker.min.js"></script>
<script src="${ctx}/assets/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="${ctx}/assets/js/jquery.paging.min.js"></script>
<script src="${ctx}/assets/js/chart/introduce.js"></script>
</@override>
<@extends name="../layout.ftl"/>
